<template>
  <div>
    <markdown-it-vue class="md-body" :content="content"/>
  </div>
</template>

<script>
import MarkdownItVue from "markdown-it-vue";

export default {
  name:'Markdown',
  components: {
    MarkdownItVue
  },
  data() {
    return {
      content:''
    };
  },
  mounted(){
    this.render()
  },
  methods: {
    render() {
      // 接收的数据
      this.$bus.$on('changes',(content)=>{
        this.content  = content;
      })
    }
  }
};
</script>

<style lang="less" scoped>
div{
   text-indent: 2em;
}
</style>
